﻿<!--
    
/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A
 * copy of the license can be found at http://go.microsoft.com/fwlink/?LinkID=131993. If
 * you cannot locate the Microsoft Public License, please send an email to
 * mixon@microsoft.com. By using this source code in any fashion, you are agreeing to
 * be bound by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 *
 * ***************************************************************************/

-->
    
    <ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    xmlns:t="clr-namespace:MIXOnline.Descry"
    xmlns:local="clr-namespace:Microsoft.Controls"
    xmlns:toolkit="clr-namespace:Microsoft.Windows.Controls"
    >
    <!-- be sure to set this as a resource in VS-->
    <Style TargetType="t:VirtualizedTimelineItemsControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="t:VirtualizedTimelineItemsControl">
                        <Grid Name="MainPanel" >
                            <Grid Name="ItemsPanels" Background="#01FFFFFF">
                                <t:SurfacePanel x:Name="SurfacePanel0">
                                    <t:SurfacePanel.RenderTransform>
                                        <TranslateTransform X="0"/>
                                    </t:SurfacePanel.RenderTransform>
                                </t:SurfacePanel>
                                <t:SurfacePanel x:Name="SurfacePanel1">
                                    <t:SurfacePanel.RenderTransform>
                                        <TranslateTransform X="0"/>
                                    </t:SurfacePanel.RenderTransform>
                                </t:SurfacePanel>
                                <t:SurfacePanel x:Name="SurfacePanel2">
                                    <t:SurfacePanel.RenderTransform>
                                        <TranslateTransform X="0"/>
                                    </t:SurfacePanel.RenderTransform>
                                </t:SurfacePanel>
                            </Grid>
                            <ScrollBar  HorizontalAlignment="Right" Orientation="Vertical" Width="18" Minimum="0" SmallChange="1" Visibility="Collapsed" Name="VerticalScrollBar" Style="{StaticResource scrollBarStyle}"/>
                            <Rectangle Stroke="#FF000000" StrokeThickness="1" RadiusX="1" RadiusY="1"/>
                        </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:VirtualizedItemsControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:VirtualizedItemsControl">
                    <Grid Name="MainPanel">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <local:VirtualizingStackPanel Name="ItemsPanel"/>
                        <ScrollBar Grid.Column="1" Orientation="Vertical" Width="18" Minimum="0" SmallChange="1" Visibility="Collapsed" Name="VerticalScrollBar"  Style="{StaticResource scrollBarStyle}"/>
                        <ScrollBar Grid.Row="1" Orientation="Horizontal" Height="18" Minimum="0" SmallChange="10" Visibility="Collapsed" Name="HorizontalScrollBar"  Style="{StaticResource scrollBarStyle}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Default style for System.Windows.Controls.ListBoxItem -->
    <Style TargetType="local:VirtualizedListBoxItem">
        <Setter Property="IsEnabled" Value="true" />
        <Setter Property="Foreground" Value="#FF000000" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Cursor" Value="Arrow" />
        <!--<Setter Property="TextAlignment" Value="Left" />-->
        <!-- doesn't work in RTM-->
        <!--<Setter Property="TextWrapping" Value="NoWrap" />-->
        <!-- doesn't work in RTM-->
        <!-- Cannot currently parse FontFamily type in XAML so it's being set in code -->
        <Setter Property="FontFamily" Value="Trebuchet MS" />
        <Setter Property="FontSize" Value="12" />
        <!--<Setter Property="Background" Value="White" />-->
        <Setter Property="Padding" Value="2,0,0,0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:VirtualizedListBoxItem">
                    <Grid Background="{TemplateBinding Background}">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HoverOverlay" Storyboard.TargetProperty="Opacity" To="0" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="fillStop0Hover" Storyboard.TargetProperty="Color" To="#00000000" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="fillStop1Hover" Storyboard.TargetProperty="Color" To="#00000000" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="fillStop2Hover" Storyboard.TargetProperty="Color" To="#00000000" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="strokeStop0Hover" Storyboard.TargetProperty="Color" To="#00000000" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="strokeStop1Hover" Storyboard.TargetProperty="Color" To="#00000000" Duration="0" />
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HoverOverlay" Storyboard.TargetProperty="Opacity" To=".75" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="fillStop0Hover" Storyboard.TargetProperty="Color" To="#FFF9FAFA" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="fillStop1Hover" Storyboard.TargetProperty="Color" To="#FFD6DFE7" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="fillStop2Hover" Storyboard.TargetProperty="Color" To="#FFD3E4F5" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="strokeStop0Hover" Storyboard.TargetProperty="Color" To="#00000000" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="strokeStop1Hover" Storyboard.TargetProperty="Color" To="#00000000" Duration="0" />
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="SelectionStates">
                                <vsm:VisualState x:Name="Unselected">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="fillStop0" Storyboard.TargetProperty="Color" To="#00000000" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="fillStop1" Storyboard.TargetProperty="Color" To="#00000000" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="fillStop2" Storyboard.TargetProperty="Color" To="#00000000" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="strokeStop0" Storyboard.TargetProperty="Color" To="#00000000" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="strokeStop1" Storyboard.TargetProperty="Color" To="#00000000" Duration="0" />
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="fillStop0" Storyboard.TargetProperty="Color" To="#FFD9EFFF" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="fillStop1" Storyboard.TargetProperty="Color" To="#FFBDD2E6" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="fillStop2" Storyboard.TargetProperty="Color" To="#FFA1B6CD" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="strokeStop0" Storyboard.TargetProperty="Color" To="#FF77B9EB" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="strokeStop1" Storyboard.TargetProperty="Color" To="#FF4887CD" Duration="0" />
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>

                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <Rectangle IsHitTestVisible="False">
                            <Rectangle.Fill>
                                <LinearGradientBrush StartPoint="0.316111,0.0165521" EndPoint="0.316111,0.724833">
                                    <GradientStop x:Name="fillStop0" Color="#00000000" Offset="0"/>
                                    <GradientStop x:Name="fillStop1" Color="#00000000" Offset="0.682203"/>
                                    <GradientStop x:Name="fillStop2" Color="#00000000" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                            <Rectangle.Stroke>
                                <LinearGradientBrush StartPoint="0.318122,0.0360108" EndPoint="0.318122,0.715784">
                                    <GradientStop x:Name="strokeStop0" Color="#00000000" Offset="0"/>
                                    <GradientStop x:Name="strokeStop1" Color="#00000000" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Stroke>
                        </Rectangle>
                        <Rectangle x:Name="HoverOverlay" IsHitTestVisible="False" Opacity="0">
                            <Rectangle.Fill>
                                <LinearGradientBrush StartPoint="0.316111,0.0165521" EndPoint="0.316111,0.724833">
                                    <GradientStop x:Name="fillStop0Hover" Color="#00000000" Offset="0"/>
                                    <GradientStop x:Name="fillStop1Hover" Color="#00000000" Offset="0.682203"/>
                                    <GradientStop x:Name="fillStop2Hover" Color="#00000000" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                            <Rectangle.Stroke>
                                <LinearGradientBrush StartPoint="0.318122,0.0360108" EndPoint="0.318122,0.715784">
                                    <GradientStop x:Name="strokeStop0Hover" Color="#00000000" Offset="0"/>
                                    <GradientStop x:Name="strokeStop1Hover" Color="#00000000" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Stroke>
                        </Rectangle>

                        <Rectangle x:Name="FocusVisual" Stroke="Black" StrokeDashArray="1,2" Visibility="Collapsed" IsHitTestVisible="False"/>
                        
                        <ContentPresenter
                          Content="{TemplateBinding Content}"
                          ContentTemplate="{TemplateBinding ContentTemplate}"
                          HorizontalAlignment="Left"
                           />
                        
                        <!--<Line Stretch="Fill" Grid.Row="1" X1="0" X2="1" Y1="0" Y2="0" StrokeThickness="1" Stroke="#FFA4A4A4" IsHitTestVisible="False"/>-->
                        
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  controls:AutoCompleteBox  -->
    <Style TargetType="toolkit:AutoCompleteBox">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:AutoCompleteBox">
                    <Grid Margin="{TemplateBinding Padding}" Background="{TemplateBinding Background}">
                        <TextBox IsTabStop="True" x:Name="Text" Style="{TemplateBinding TextBoxStyle}" Margin="0" Background="#FF363636" BorderThickness="0" Foreground="#FF838383" FontWeight="Bold"/>
                        <Popup x:Name="Popup">
                            <Border x:Name="PopupBorder" HorizontalAlignment="Stretch" Opacity="0.0" BorderThickness="0" CornerRadius="5">
                                <Border.RenderTransform>
                                    <TranslateTransform X="1" Y="1" />
                                </Border.RenderTransform>
                                <Border.Background>
                                    <SolidColorBrush Color="#11000000" />
                                </Border.Background>
                                <Border HorizontalAlignment="Stretch" Opacity="1.0" Padding="0" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="5">
                                    <Border.RenderTransform>
                                        <TransformGroup>
                                            <TranslateTransform X="-1" Y="-1" />
                                        </TransformGroup>
                                    </Border.RenderTransform>
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF999999" Offset="0" />
                                            <GradientStop Color="#AA999999" Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <ListBox x:Name="SelectionAdapter" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" ItemContainerStyle="{TemplateBinding ItemContainerStyle}" ItemTemplate="{TemplateBinding ItemTemplate}" Background="#FF363636" Foreground="#FF838383" FontWeight="Bold" />
                                </Border>
                            </Border>
                        </Popup>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="PopupStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.1" To="PopupOpened" />
                                    <VisualTransition GeneratedDuration="0:0:0.5" To="PopupClosed" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="PopupOpened">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="Opacity" To="1.0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PopupClosed">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="Opacity" To="0.0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>



</ResourceDictionary>
